

jQuery(function ($) {
    //友情链接
    var params = {
        "WebPage": {
            "page_sn": "goods_search"
        },
        "[]": {
            "FriendlyLinkPage": {
                "page_id@": "WebPage/id"
            },
            "FriendlyLink": {
                "id@": "[]/FriendlyLinkPage/friendly_link_id"
            }
        }
    };
    send_ajax('post', '/get', params, function callback(res) {
        if (res.code == 200 && res["[]"]) {
            var data = res["[]"];
            for (var i = 0; i < data.length; i++) {
                $('.friendly_link').append("<li><a href=\"" + data[i].FriendlyLink.link + "\" target=\"_blank\" title=\"" + data[i].FriendlyLink.title + "\">" + data[i].FriendlyLink.title + "</a></li>");
            }
        }
    });

    //帮助中心
    var params_help = {
        "HelpCat[]": {
            "HelpCat": {
                "@order": "rank-",
                "Help[]": {
                    "Help": {
                        "cat_id@": "HelpCat[]/HelpCat/id",
                        "use_flag": 1
                    }
                }
            }
        }
    };
    send_ajax('post', '/get', params_help, function callback(res) {
        if (res.code == 200 && res["HelpCat[]"]) {
            var data = res["HelpCat[]"];
            $(".navigation_index").empty;
            var navigation_index_html = "";
            for (var i = 0; i < data.length; i++) {
                var a_help_cat = data[i];
                var a_help_list = a_help_cat["Help[]"];
                var name = a_help_cat["name"];

                var lis_html = "";
                for (var _i = 0; _i < a_help_list.length; _i++) {
                    var li_obj = a_help_list[_i];
                    var a_li = "<li><a target=\"_blank\" href=\"/help-" + li_obj.id + ".html\">" + li_obj.title + "</a></li>";
                    lis_html += a_li;
                }

                var help_cat_str = "<div class=\"shopping_guide\">\n                    <strong>" + a_help_cat.name + "</strong>\n                    <ul>\n                        " + lis_html + "\n                    </ul>\n                </div>";

                navigation_index_html += help_cat_str;
            }
            $('.navigation_index').html(navigation_index_html);
            $('.navigation_index').append(' <div class="free_tel">\
            <div>\
                <p>全国免费订购热线</p>\
                <p>400-000-8888</p>\
            </div>\
            <div style="margin-top:12px">\
                <p>短信订购：</p>\
                <p>13716681031</p>\
            </div>\
        </div>\
        <div class="weixinCode"></div>')
        }
    });
});